﻿<%@ Page Language="C#" Theme="SkinAdmin" AutoEventWireup="true" CodeBehind="Titulos.aspx.cs"
    Inherits="Bukstor.Admin.UI.Titulos" MasterPageFile="~/MasterAdmin.Master" %>

<asp:Content ContentPlaceHolderID="head" runat="server">
    <title>Titulos</title>
    <style type="text/css">
        #ImagenTapa
        {
            top: 308px;
            left: 866px;
        }
    </style>
</asp:Content>
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <br />
    <div align="center">
        <asp:Button ID="btnEditoriales" runat="server" Text="IR A EDITORIALES" PostBackUrl="~/Editoriales.aspx" /><br />
    </div>
    <div align="center">
        <asp:Button ID="btnAutores" runat="server" Text="IR A AUTORES" PostBackUrl="~/Autores.aspx" /><br />
    </div>
    <div align="center">
        <asp:Button ID="btnSubcategorias" runat="server" Text="IR A SUBCATEGORIAS" PostBackUrl="~/Subcategorias.aspx" /></div>
    <br />
    <br />
    <asp:Panel ID="pnlEdicion" runat="server" BorderWidth="1px" Height="510px" CssClass="centered">
        <asp:Panel ID="pnlCampos" runat="server">
            <div class="form-labels-titulos">
                <div class="form-label" align="right">
                    <asp:Label ID="lblIsbn" runat="server" Text="ISBN"></asp:Label></div>
                <div class="form-label" align="right">
                    <asp:Label ID="lblTitulo" runat="server" Text="Titulo"></asp:Label></div>
                <div class="form-label-tall" align="right">
                    <asp:Label ID="lblAutor" runat="server" Text="Autor"></asp:Label></div>
                <div class="form-label" align="right">
                    <asp:Label ID="lblEditorial" runat="server" Text="Editorial"></asp:Label></div>
                <div style="height: 44px" align="right">
                    <asp:Label ID="lblTapa" runat="server" Text="Tapa"></asp:Label></div>
                <div class="form-label-tall" align="right">
                    <asp:Label ID="lblSinopsis" runat="server" Text="Sinopsis"></asp:Label></div>
                <div class="form-label" align="right">
                    <asp:Label ID="lblSubcategoria" runat="server" Text="Subcategoria"></asp:Label></div>
                <div class="form-label" align="right">
                    <asp:Label ID="lblDiscontinuo" runat="server" Text="Discontinuo"></asp:Label></div>
                <div class="form-label" align="right">
                    <asp:Label ID="lblPrecio" runat="server" Text="Precio"></asp:Label></div>
            </div>
            <div class="form-fields">
                <div class="form-field">
                    <asp:TextBox ID="txtIsbn" runat="server" Width="380px"></asp:TextBox>
                </div>
                <div class="form-field">
                    <asp:TextBox ID="txtTitulo" runat="server" Width="380px"></asp:TextBox></div>
                <div class="form-field-tall">
                    <asp:CheckBoxList ID="cblAutores" runat="server" BorderWidth="1px" DataSourceID="ObjectDataSourceAutores"
                        DataTextField="NomresAutor" DataValueField="IdAutor" Height="80px" Width="400px">
                    </asp:CheckBoxList>
                </div>
                <div class="form-field">
                    <asp:DropDownList ID="ddlEditorial" runat="server" DataSourceID="edsEditoriales"
                        DataTextField="nombre" DataValueField="id" Width="400px" Height="26px">
                    </asp:DropDownList>
                    <asp:EntityDataSource ID="edsEditoriales" runat="server" ConnectionString="name=BukstorBDEntities"
                        DefaultContainerName="BukstorBDEntities" EnableFlattening="False" EntitySetName="Editoriales">
                    </asp:EntityDataSource>
                </div>
                <div>
                    <asp:FileUpload ID="fuTapa" runat="server" Width="283px" Height="45px" />&nbsp;<asp:Button
                        ID="btnVerFoto" runat="server" Text="VER FOTO" Height="25px" OnClick="btnVerFoto_Click" />
                    <asp:HiddenField ID="hidTapa" runat="server" />
                </div>
                <div class="form-field-tall">
                    <asp:TextBox ID="txtSinopsis" runat="server" Height="80px" Rows="4" TextMode="MultiLine"
                        Width="400px"></asp:TextBox></div>
                <div class="form-field">
                    <asp:DropDownList ID="ddlSubcategorias" runat="server" DataSourceID="EntityDataSourceSubcategorias"
                        DataTextField="nombre" DataValueField="id" Width="400px">
                    </asp:DropDownList>
                </div>
                <div class="form-field">
                    <asp:DropDownList ID="ddlDiscontinuo" runat="server" Width="400px">
                        <asp:ListItem>si</asp:ListItem>
                        <asp:ListItem>no</asp:ListItem>
                    </asp:DropDownList>
                </div>
                <div class="form-field">
                    <asp:TextBox ID="txtPrecio" runat="server" Width="380px"></asp:TextBox></div>
            </div>
        </asp:Panel>
    </asp:Panel>
    <asp:HiddenField ID="hidIdLibro" runat="server" />
    <div align="center">
        <asp:Button ID="btnAlta" runat="server" Text="ALTA TITULO" OnClick="btnAlta_OnClick" /></div><br />
    <div align="center">
        <asp:Button ID="btnModificar" runat="server" Text="MODIFICAR TITULO SELECCIONADO"
            OnClick="btnModificar_Click" Enabled="False" /></div><br />
    <div id="ImagenTapa" style="width: 120px; height: 170px; position: absolute">
        <asp:Image ID="imgFoto" runat="server" Height="150px" ImageAlign="AbsMiddle" Width="100px" />
    </div>
    <asp:Panel ID="Panel1" runat="server">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1"
            OnSelectedIndexChanged="GridView1_SelectedIndexChanged1">
            <Columns>
                <asp:CommandField ShowSelectButton="True" ButtonType="Image" 
                    HeaderText="Seleccion" SelectImageUrl="~/Imagenes/icoOk.jpeg" />
                <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
                <asp:BoundField DataField="Titulo" HeaderText="Titulo" SortExpression="Titulo" />
                <asp:BoundField DataField="Autor" HeaderText="Autor" SortExpression="Autor" />
                <asp:BoundField DataField="Isbn" HeaderText="Isbn" SortExpression="Isbn" />
                <asp:BoundField DataField="Editorial" HeaderText="Editorial" SortExpression="Editorial" />
                <asp:BoundField DataField="Sinopsis" HeaderText="Sinopsis" SortExpression="Sinopsis" />
                <asp:BoundField DataField="Subcategoria" HeaderText="Subcategoria" SortExpression="Subcategoria" />
                <asp:CheckBoxField DataField="Discontinuo" HeaderText="Discontinuo" SortExpression="Discontinuo" />
                <asp:BoundField DataField="Precio" HeaderText="Precio" SortExpression="Precio" />
            </Columns>
        </asp:GridView>
    </asp:Panel>
    <asp:Panel ID="Panel2" runat="server">
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="listarLibros"
            TypeName="Bukstor.Admin.UI.Titulos"></asp:ObjectDataSource>
        <br />
        <asp:EntityDataSource ID="EntityDataSourceSubcategorias" runat="server" ConnectionString="name=BukstorBDEntities"
            DefaultContainerName="BukstorBDEntities" EntitySetName="Subcategorias">
        </asp:EntityDataSource>
        <asp:ObjectDataSource ID="ObjectDataSourceAutores" runat="server" SelectMethod="traerAutores"
            TypeName="Bukstor.Admin.UI.Titulos"></asp:ObjectDataSource>
    </asp:Panel>
</asp:Content>
